/*
 * Copyright (C) 2010-2010 MaoJian Wu
 *
 * Author:
 *	MaoJian Wu
 *
 * Source:
 *	
 *
 * This file is a part of zfspear library.
 *
 *
 */

#ifndef XMPP_ELEMENT_FACTORY_H
#define XMPP_ELEMENT_FACTORY_H

#include <QString>
#include <QMetaObject>
#include <QHash>
#include <QMutex>


class XmppElement;
class ElementType;
class XmppElementFactory
{
public:
    XmppElementFactory();
    static void AddElementType(const QString& tag,const QString& ns,QMetaObject metaObject);
    static XmppElement* GetElement(const QString& prefix,const QString& tag,const QString& ns);
private:
    static QHash<ElementType,QMetaObject> s_hash_;
    static QMutex *s_mutex_;
};

#endif // XMPP_ELEMENT_FACTORY_H
